package cn.thoughtworks.school.repositories;

import cn.thoughtworks.school.entities.Stack;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface StackRepository extends JpaRepository<Stack, Long> {
  List<Stack> findAllByOrganizationId(Long organizationId);

  Page<Stack> findAllByOrganizationId(Long organizationId, Pageable pageable);

  Stack findStackByImageAndOrganizationId(String image, Long organizationId);

  Optional<Stack>  findByTitleAndOrganizationId(String title, Long organizationId);
}
